package com.mandao.concurrency.example.publish;

import com.mandao.concurrency.annotations.NotThreadSafe;
import lombok.extern.slf4j.Slf4j;

import java.util.Arrays;

/**
 *  不安全的
 */
@Slf4j
@NotThreadSafe
public class UnSafePublish {
    private String[] stats = {"a","b","c"};

    public String[] getStats(){
        return stats;
    }

    public static void main (String[] args){
        UnSafePublish unSafePublish = new UnSafePublish();
        log.info("{}",Arrays.toString(unSafePublish.getStats()));

        unSafePublish.getStats()[0] = "d";
        log.info("{}",Arrays.toString(unSafePublish.getStats()));
    }
}
